package cn.cheln.explorer.cpnt.adapter;

import android.content.Context;
import android.view.View;
import cn.cheln.explorer.beans.FileInfo;
import cn.cheln.support.highlight.KeyMatcher;
import cn.cheln.support.highlight.TextHighLightDecorator;
import cn.cheln.support.ui.adapter.MapAdapter.AdaptInfo;
import java.util.Arrays;
import java.util.List;

public class SearchAdapter extends CountAdapter
{
  int color;
  TextHighLightDecorator decoratorHighLight;
  List<String> fieldstoimpose;
  KeyMatcher matcher = new KeyMatcher("");

  public SearchAdapter(Context paramContext, MapAdapter.AdaptInfo paramAdaptInfo)
  {
    super(paramContext, paramAdaptInfo);
  }

  protected void findAndBindView(View paramView, int paramInt, Object paramObject1, String paramString, Object paramObject2)
  {
    if ((this.decoratorHighLight != null) && (this.fieldstoimpose != null) && (this.fieldstoimpose.contains(paramString)))
      paramObject2 = this.decoratorHighLight.getDecorated(paramObject2.toString(), ((FileInfo)paramObject1).getName(), ((FileInfo)paramObject1).sortKey);
    super.findAndBindView(paramView, paramInt, paramObject1, paramString, paramObject2);
  }

  public FileInfo getSimpleFileItem(int paramInt)
  {
    return ((FileInfo)getItem(paramInt));
  }

  protected void getViewInDetail(Object paramObject, int paramInt, View paramView)
  {
    if (paramObject != null);
    try
    {
      if (((FileInfo)paramObject).count.intValue() == -2)
        ((FileInfo)paramObject).sizeText = "";
      super.getViewInDetail(paramObject, paramInt, paramView);
      paramView.findViewById(2131230804).setVisibility(8);
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public void setHighlightInfo(String paramString, String[] paramArrayOfString, int paramInt)
  {
    try
    {
      this.decoratorHighLight = new TextHighLightDecorator(paramInt);
      switchKeyWords(paramString);
      this.fieldstoimpose = Arrays.asList(paramArrayOfString);
      this.color = paramInt;
      return;
    }
    catch (Exception localException)
    {
      localException.printStackTrace();
    }
  }

  public void switchKeyWords(String paramString)
  {
    this.matcher = new KeyMatcher(paramString);
    this.decoratorHighLight.setMatcher(this.matcher);
  }
}

/* Location:           H:\360云盘\lewa_explorer_3.0\bin\FileApp_orig_dex2jar.jar
 * Qualified Name:     cn.cheln.explorer.cpnt.adapter.SearchAdapter
 * JD-Core Version:    0.5.2
 */